<?php
namespace app\adminbackstage\controller;

use Tools\Spread;
use think\facade\Session;
use think\facade\Request;

use app\adminbackstage\model\Withdrawal;
use app\adminbackstage\model\Operation;


use app\common\model\Detailed;
//use app\adminfocus\model\User;
use app\adminbackstage\model\User_amount;
use app\adminbackstage\model\PreDup;
use app\adminbackstage\model\User;
use think\facade\Db;
use app\crontab\model\CrontabOrderTrial;

/*
 * 提现审核
 */

/**
 * Description of Index
 *
 * @author asus80
 */
class WithdrawalController {

    //提现列表
    public function withdrawalList(){
        $page = Request::param('page');
        $num = Request::param('num');
        
        $black_name = array('樊建涛','高淞','李丹阳','孙培杰');

        $no_order = Request::param('no_order');//订单编号
        $withdrawal_amount = Request::param('withdrawal');//提现金额
        $transfer_card = Request::param('transfer_card');//转账卡号 支付宝号
        $start = Request::param('start');
        $end = Request::param('end');
        $phone = Request::param('phone');
        
        $state = Request::param('state');//状态
        $transfer_name = Request::param('transfer_name');//转账人姓名

        $auditstart = Request::param('auditstart');//审核时间
        $auditend = Request::param('auditend');//审核时间
        $wit_level = Request::param('wit_level');

        $uid = Request::param('uid');
        $type = Request::param('usertype');
        $black = Request::param('black');//黑号判断
        $num_su = Request::param('num_su');//提现成功数
        
        $or = 0;
        
        $where = [];
        $where[] = ['w.type','=',1];
        
        if(!empty($black)){
            
            $where[] = ['w.black','=',$black];
        }
//        else{
//            $where[] = ['w.black','=',$black];
//        }
        
        if(!empty($type)){
            
            $where[] = ['u.type','=',$type];
        }
        
        if(!empty($no_order)){
            $or = 1;
            $where[] = ['w.no_order','=',$no_order];
        }
        
        if(!empty($start)){
            $or = 1;
            $time_start = strtotime($start);
            $where[] = ['w.addtime','>=',$time_start];
        }
        
        if(!empty($end)){
            $or = 1;
            $time_end = strtotime($end)+(24*3600-1);
            $where[] = ['w.addtime','<',$time_end];
        }
        
        if(!empty($phone)){
            $or = 1;
            //$where[] = ['u.phone','like',"%$phone%"];
            $where[] = ['u.phone','=',$phone];
        }
        
        if(!empty($num_su)){
            $or = 1;
            $where[] = ['u.num_su','>=',$num_su];
        }
        
        if(!empty($wit_level)){
            $or = 1;
            $where[] = ['u.wit_level','=',$wit_level];
        }

        if(!empty($transfer_name)){
            $or = 1;
            //$where[] = ['w.transfer_name','like',"%$transfer_name%"];
            $where[] = ['w.transfer_name','=',$transfer_name];
        }
        
        if(!empty($state)){
            if($state == -1){
                $state = 0;
            }
            $or = 1;
            $where[] = ['w.state','=',$state];
        }
        
        if(!empty($auditstart)){
            $or = 1;
            $where[] = ['w.audittime','>=',$auditstart];
        }
        
        if(!empty($auditend)){
            $or = 1;
            $where[] = ['w.audittime','<',$auditend];
        }
        
        if(!empty($transfer_card)){
            $or = 1;
            //$where[] = ['w.transfer_card','like',"%$transfer_card%"];
            $where[] = ['w.transfer_card','=',$transfer_card];
        }
        
        
        if(!empty($withdrawal_amount)){
            $or = 1;
            $where[] = ['w.withdrawal','=',$withdrawal_amount];
        }
        
        if($or ==0){
            //$where[] = ['w.id','>',390000];
        }
        
        $withdrawal = new Withdrawal();
        

        $listinfo = $withdrawal->withdrawalList($page,$num,$where)->toArray();

        $count = $withdrawal->withdrawalCount($where); 
        
        
//        $cp = ceil($count/$num);//总页数
//        
//        $statistics = '共'.$cp.'页 '.$count.'条记录'; 
//        
//        $top = '<li><a href="javascript:;" class="pt" title="'.($page-1).'">Prev</a></li>';
//        $tail = '<li><a href="javascript:;" class="pt" title="'.($page+1).'">Next</a></li></ul>';
//        
//        if($page == 1){
//            $top = '<li><a href="javascript:;">Prev</a></li>';
//        }
//        
//        if($cp == 1){
//            $top = '<li><a href="javascript:;">Prev</a></li>';
//            $tail = '<li><a href="javascript:;">Next</a></li></ul>';
//        }
//
//        if($page == $cp){
//            $tail = '<li><a href="javascript:;">Next</a></li></ul>';
//        }

        foreach ($listinfo as $key => $value) {
            if ($value['state']==0) {
                $listinfo[$key]['state_str'] = '待审核';
            }
            elseif($value['state']==1){
                $listinfo[$key]['state_str'] = '审核通过(待打款)';
            }
            elseif ($value['state']==2) {
                $listinfo[$key]['state_str'] = '审核失败';
            }
            elseif ($value['state']==3) {
                $listinfo[$key]['state_str'] = '已打款';
            }
            
            if(in_array($value['transfer_name'],$black_name)==1){
                $listinfo[$key]['transfer_name_str'] = '风险账户';
            }
            else{
                $listinfo[$key]['transfer_name_str'] = '';
            }
            
            $listinfo[$key]['time'] = date( "Y-m-d H:i:s",$value['addtime']); 
            $listinfo[$key]['addtime'] = date( "Y-m-d H:i:s",$value['addtime']);
            $listinfo[$key]['uaddtime'] = date( "Y-m-d H:i:s",$value['uaddtime']);
            $listinfo[$key]['autime'] = '';
            if(!empty($value['audittime'])){
                $listinfo[$key]['autime'] = date( "Y-m-d H:i:s",$value['audittime']); 
                $listinfo[$key]['audittime'] = date( "Y-m-d H:i:s",$value['audittime']); 
            }
            //1未判断 5初步排查 10需再次排查 20信任
            if($value['wit_level']==1){
                $value['wit_level_str'] = '未判断';
            }
            elseif ($value['wit_level']==5) {
                $listinfo[$key]['wit_level_str'] = '初步排查';
            }
            elseif ($value['wit_level']==10) {
                $listinfo[$key]['wit_level_str'] = '需再次排查';
            }
            elseif ($value['wit_level']==20) {
                $listinfo[$key]['wit_level_str'] = '信任';
            }
            
            
        }
        
//        $list = '<ul>'.$top.$tail.'</ul>';
//        $return = array($listinfo,$list,$statistics);
//        
//        echo json_encode($return);
        
        return json(['code' => 1, 'msg' => lang(''), 'data' => $listinfo, 'count' => $count]);

    }
    
    
    //提现详情
    public function withdrawalInfo(){

        $id = Request::param('id');
        
        $uid = Request::param('uid');
        
        $withdrawal = new Withdrawal();
        
        $where[] = ['id','=',$id];
        $return = $withdrawal->withdrawalInfo($where)->toArray();

        if ($return['state']==0) {
            $return['state_str'] = '待审核';
        }
        elseif($return['state']==1){
            $return['state_str'] = '审核通过(待打款)';
        }
        elseif ($return['state']==2) {
            $return['state_str'] = '审核失败';
        }
        elseif ($return['state']==3) {
            $return['state_str'] = '已打款';
        }

        $return['time_str'] = date( "Y-m-d H:i:s",$return['addtime']); 
        $return['autime'] = '';
        if(!empty($return['audittime'])){
            $return['autime'] = date( "Y-m-d H:i:s",$return['audittime']); 
        }
        
//        echo json_encode($return);
        return json(['code' => 1, 'msg' => lang(''), 'data' => $return, 'count' => '']);
    }
    
    
    //提现状态变更
    public function adopt(){
        
//        $a_uid = session('uid');
        $a_uid = Request::param('a_uid');

        if($a_uid != 1){
            //return json(['code' => 0, 'msg' => lang('该账号无操作权限'), 'data' =>'', 'count' => '']);
        }
        //adopt="+adopt+'&remarks='+remarks+'&w_id='+w_id+'&w_uid='+w_uid
        $id = Request::param('id');
        $uid = Request::param('uid');
        $state = Request::param('state');
        $remarks = Request::param('remarks');
        $to_account = Request::param('to_account');//到账金额
        $fee = Request::param('fee');
        $withdrawal = Request::param('withdrawal');
        $no_order = Request::param('no_order');
        
        
        $c_withdrawal = new Withdrawal();
        
        Db::startTrans();//开启事务
        
        $time = time();
        $user_amount = new User_amount();

        $userAmountInfo = $user_amount->userFind($uid)->toArray();
        
        $da_data['uid'] = $uid;
        $da_data['amount_money'] = $withdrawal;
        $da_data['state'] = 1;
        $da_data['type'] = 1;
        
        $da_data['addtime'] = $time;
        
                    
        $where = [];
        $where[] = ['w.id','=',$id];
        $return = $c_withdrawal->withdrawalInfo($where)->toArray();
        
        $user = new User();

        if($state == 1 ){
            if($return['state']!=0){
                return json(['code' => 0, 'msg' => lang('操作异常!'), 'data' =>'', 'count' => '']);
            }
            
            $update = ['state' => $state,'passtime' => $time];
            
//            $update_amount = ["freezing_amount"=>$userAmountInfo['freezing_amount']-$withdrawal];
//            
//            $detailed[] = \detailed($da_data['uid'],$to_account,'withdrawal_success',$userAmountInfo['balance'],$id,'',$no_order);//实际到账金额
//            if($fee > 0){
//                $detailed[] = \detailed($da_data['uid'],$fee,'withdrawal_fee',$userAmountInfo['balance'],$id,'',$no_order);//手续费
//            }

        }
        elseif($state == 2 ){
            if($return['state']>1){
                return json(['code' => 0, 'msg' => lang('操作异常'), 'data' =>'', 'count' => '']);
            }
            $update = ['state' => $state,'audittime' => $time,'remarks'=>$remarks];
            $update_amount = ["balance"=>$userAmountInfo['balance']+$withdrawal,"freezing_amount"=>$userAmountInfo['freezing_amount']-$withdrawal];
            //防重复
            $data_pd = [
                'uid' => $return['uid'],
                'corr_id' => $return['id'],
                'type' => 4,
                'addtime' => $time,
            ];
            
            $detailed[] = \detailed($da_data['uid'],$da_data['amount_money'],'withdrawal_unfreeze',$userAmountInfo['balance'],$id,'',$no_order,"-".$remarks);//提现失败回退
            $PreDupAdd = PreDup::PreDupAdd($data_pd);
            Detailed::detailedAddAll($detailed);

        }
        elseif($state == 3){
            
            if($return['state'] != 1){
                return json(['code' => 0, 'msg' => lang('操作异常'), 'data' =>'', 'count' => '']);
            }
            //防重复
            $data_pd = [
                'uid' => $return['uid'],
                'corr_id' => $return['id'],
                'type' => 4,
                'addtime' => $time,
            ];
            
            $update = ['state' => $state,'audittime' => $time];
            
            $update_amount = ["freezing_amount"=>$userAmountInfo['freezing_amount']-$withdrawal];
            
            $detailed[] = \detailed($da_data['uid'],$to_account,'withdrawal_success',$userAmountInfo['balance'],$id,'',$no_order);//实际到账金额
            if($fee > 0){
                $detailed[] = \detailed($da_data['uid'],$fee,'withdrawal_fee',$userAmountInfo['balance'],$id,'',$no_order);//手续费
            }
            $PreDupAdd = PreDup::PreDupAdd($data_pd);
            Detailed::detailedAddAll($detailed);
            $update_u = ['num_su' => $return['num_su']+1];
            $user->userUpdate($return['uid'],$update_u);
        }
        
        
        $c_withdrawal->withdrawalEdit($id,$update);
        
        if($state != 1){
            $user_amount->user_amountUpdate($uid,$update_amount);
        }
        
        
        $operation = new Operation();
  
        $data = [
                'uid' => $a_uid,
                'operation' => '提现审核状态变更---'.$state,
                'main_table' => 'nh_withdrawal',
                'mt_id' => $id,
                'addtime' => $time,
            ];
        $operation->operationAdd($data);
        Db::commit();//事务提交
        return json(['code' => 1, 'msg' => lang(''), 'data' =>'', 'count' => '']);
    }
    
    //批量审核
    public function adoptBatch(){
//        $a_uid = session('uid');
//        
//        $a_username = session('username');
//        if($a_uid != 1 && $a_username != 'admin'){
//            echo '2';exit;
//        }
        
        $a_uid = Request::param('a_uid');
        $batch = Request::param('batch');
        $state = Request::param('state');


        if($a_uid != 1 ){
            //return json(['code' => 0, 'msg' => lang('该账号无操作权限'), 'data' =>'', 'count' => '']);
        }
        $time = time();
        $batcharray = explode(",", $batch);
        $c_withdrawal = new Withdrawal();
        
        $operation = new Operation();
        //63-8-100.98-1.02-102.00-W2020052116533151942,64-13-1013.00-10.23-1023.23-W2020052117192683529,66-3-12.00-0.00-12.00-W2020052315583321669
        $user_amount = new User_amount();
        $user = new User();
        $detailed = array();
        $data = [];
        $data_pd = [];
        Db::startTrans();//开启事务
        foreach ($batcharray as $value) {
            $strarr = explode("-", $value);

            if($state == 1){
                $where = [];
                $where[] = ['id','=',$strarr[0]];
                $return = $c_withdrawal->withdrawalInfo($where)->toArray();
                if($return['state'] >0){
                    continue;
                }
                $update = ['state' => $state,'passtime' => $time];
                $c_withdrawal->withdrawalEdit($strarr[0],$update);
            }
            
            
            if($state == 3){

                $where = [];
                $where[] = ['id','=',$strarr[0]];
                $return = $c_withdrawal->withdrawalInfo($where)->toArray();
                if($return['state'] != 1){
                    continue;
                }
                
                //防重复
                $data_pd = [
                    'uid' => $return['uid'],
                    'corr_id' => $return['id'],
                    'type' => 4,
                    'addtime' => $time,
                ];
                $PreDupAdd = PreDup::PreDupAdd($data_pd);
                
                $userAmountInfo = $user_amount->userFind($strarr[1])->toArray();
                
                $da_data['uid'] = $strarr[1];
                $da_data['amount_money'] = $strarr[4];

                $update_amount = ["freezing_amount"=>$userAmountInfo['freezing_amount']-$strarr[4]];

                $detailed[] = \detailed($da_data['uid'],$strarr[2],'withdrawal_success',$userAmountInfo['balance'],$strarr[0],'',$strarr[5]);//实际到账金额
                if($strarr[3] > 0){
                    $detailed[] = \detailed($da_data['uid'],$strarr[3],'withdrawal_fee',$userAmountInfo['balance'],$strarr[0],'',$strarr[5]);//手续费
                }
                
                
                $user_amount->user_amountUpdate($da_data['uid'],$update_amount);
                $update_u = ['num_su' => $return['num_su']+1];
                $user->userUpdate($return['uid'],$update_u);
                $update = ['state' => $state,'audittime' => $time];
                $c_withdrawal->withdrawalEdit($strarr[0],$update);
            }
            
            
            

            
 
            $data[] = [
                'uid' => $a_uid,
                'operation' => '提现审核状态变更---'.$state,
                'main_table' => 'nh_withdrawal',
                'mt_id' => $strarr[0],
                'addtime' => $time,
            ];
            
            
        }
        
        $operation->operationAddAll($data);
        Detailed::detailedAddAll($detailed);
        Db::commit();//事务提交
        return json(['code' => 1, 'msg' => lang(''), 'data' => '', 'count' => '']);
    }
    
    /*
    public function adoptxg(){

        

        $time = time();
        //$batcharray = explode(",", $batch);
        $c_withdrawal = new Withdrawal();
        
        //$operation = new Operation();
        //63-8-100.98-1.02-102.00-W2020052116533151942,64-13-1013.00-10.23-1023.23-W2020052117192683529,66-3-12.00-0.00-12.00-W2020052315583321669
        $user_amount = new User_amount();
        $user = new User();
        $detailed = array();
        $data = [];
        $data_pd = [];
        
        Db::startTrans();//开启事务
        //select * from pg_withdrawal where  audittime=1650277159 and type=1 order by id desc 
        $sql = "select * from pg_withdrawal where  audittime=1650277159 and type=1 order by id desc ";
        $orderTrialSQl = CrontabOrderTrial::orderTrialSQl($sql);
        
        foreach ($orderTrialSQl as $value) {
            //$strarr = explode("-", $value);

            //$where = [];
            //$where[] = ['id','=',$value['uid']];
            //$return = $c_withdrawal->withdrawalInfo($where)->toArray();
            
            $userAmountInfo = $user_amount->userFind($value['uid'])->toArray();

            //$da_data['uid'] = $value['uid'];
            //$da_data['amount_money'] = $value['withdrawal'];


            $detailed[] = \detailed($value['uid'],$value['withdrawal'],'withdrawal_success',$userAmountInfo['balance'],$value['id'],'',$value['no_order']);//实际到账金额
            
            
        }
 
        //$operation->operationAddAll($data);
        Detailed::detailedAddAll($detailed);
        Db::commit();//事务提交
        return json(['code' => 1, 'msg' => lang(''), 'data' => '', 'count' => '']);
    }*/
    
    
    public function excel(){
        $file = fopen('./country.xls', 'w');
        fwrite($file, "code\tname\tpopulation\t\n");
        if(mysqli_num_rows($res) > 0) {
            while($row = mysqli_fetch_array($res)) {
                fwrite($file, $row['code']."\t".$row['name']."\t".$row['population']."\t\n");//这里写得不好，应该把所有文件内容组装到一个字符串中然后一次性写入文件。
            }
        }
        fclose($file);
        echo 'http://www.jtw.com/....../country.xls';//这里返回文件路径给js
    }


    //支付宝打款 excel 导出
    public function exportExcel(){
        $phone = Request::param('phone');//用户手机号码
        $type = Request::param('type');//用户类型  type= 2商家   type=3 用户
        $wIds = Request::param('wIds'); //选中的打款提现记录id  数组   不传则为所有
        $startTime = Request::param('start');//开始时间
        $endTime = Request::param('end');//结束时间
        $where = [];
        $where[] = ['state','=',1];
        $where[] = ['w.type','=',1];
        if(!empty($phone)){
            $where[] = ['u.phone','like',"%$phone%"];
        }
        if(!empty($type)){
            $where[] = ['u.type','=',$type];
        }
        if(!empty($wIds)){
            $where[] = ['w.id','in',implode(',',$wIds)];
        }
        if(!empty($startTime)){
            $where[] = ['w.addtime','>=',strtotime($startTime)];
        }
        if(!empty($endTime)){
            $where[] = ['w.addtime','<',strtotime($endTime)+(24*60*60)];
        }
        $withdrawal = new Withdrawal();
        $list = $withdrawal->withdrawalList(1,4000,$where)->toArray();
        if(empty($list)){
            return json(['code' => 0, 'msg' => lang('未获取到需要导出数据'), 'data' => '', 'count' => '']);
        }
        $sumTOAccount = $withdrawal->withdrawalSumToAccount($where);//总计金额
        $expTableData = [];
        foreach ($list as $item){
            $exp = [];
            $exp['id'] = $item['id'];
            $exp['no_order'] = substr($item['no_order'],1,20);
            $exp['transfer_card'] = $item['transfer_card'];
            $exp['transfer_name'] = $item['transfer_name'];
            $exp['to_account'] = floatval($item['to_account']);
            $exp['remarks'] = $item['remarks'];
            $expTableData[] = $exp;
        }
        $fileName = date('Y年m月d日H时i分',time());
        $Excel['fileName']=$fileName.'支付宝批量打款明细';//or $xlsTitle
        $Excel['cellName']=['A','B','C','D','E'];
        $Excel['H'] = ['A'=>28,'B'=>28,'C'=>28,'D'=>28,'E'=>28];//横向水平宽度
        //$Excel['V'] = ['1'=>40,'2'=>26];//纵向垂直高度
        $Excel['sheetTitle']= '支付宝批量付款文件（总计金额：'.$sumTOAccount.'）';//大标题，自定义
        $Excel['xlsCell']=[
            ['no_order','序号(必填)'],
            ['transfer_card','收款方支付宝账号(必填)'],
            ['transfer_name','收款方姓名(必填)'],
            ['to_account','金额(必填,单位：元)'],
            ['remarks','备注(选填)'],
        ];

        Spread::excelPut($Excel,$expTableData);

    }
    
    //提现 excel 导出
    public function withdrawalExcel(){
        $no_order = Request::param('no_order');//订单编号
        $withdrawal_amount = Request::param('withdrawal');//提现金额
        $transfer_card = Request::param('transfer_card');//转账卡号 支付宝号
        $start = Request::param('start');
        $end = Request::param('end');
        $phone = Request::param('phone');
        
        $state = Request::param('state');//状态
        $transfer_name = Request::param('transfer_name');//转账人姓名

        $auditstart = Request::param('auditstart');//审核时间
        $auditend = Request::param('auditend');//审核时间

        $uid = Request::param('uid');
        $type = Request::param('usertype');
        $black = Request::param('black');//黑号判断
        
        $s_type = Request::param('s_type');//提现类型  1默认提现，2赏金账户提现(用户才有的参数)
        $where = [];
        if(empty($s_type)){
            $where[] = ['w.type','=',1];
        }
        else{
            $where[] = ['w.type','=',$s_type];
        }

        
        if(!empty($black)){
            $where[] = ['w.black','=',$black];
        }
//        else{
//            $where[] = ['w.black','=',$black];
//        }
        
        if(!empty($type)){
            $where[] = ['u.type','=',$type];
        }
        
        if(!empty($no_order)){
            $where[] = ['w.no_order','=',$no_order];
        }
        
        if(!empty($start)){
            $time_start = strtotime($start);
            $where[] = ['w.addtime','>=',$time_start];
        }
        
        if(!empty($end)){
            $time_end = strtotime($end)+(24*3600-1);
            $where[] = ['w.addtime','<',$time_end];
        }
        
        if(!empty($phone)){
            
            $where[] = ['u.phone','like',"%$phone%"];
        }

        if(!empty($transfer_name)){
            
            $where[] = ['w.transfer_name','like',"%$transfer_name%"];
        }
        
        if(!empty($state)){
            if($state == -1){
                $state = 0;
            }
            $where[] = ['w.state','=',$state];
        }
        
        if(!empty($auditstart)){
            $where[] = ['w.audittime','>=',$auditstart];
        }
        
        if(!empty($auditend)){
            $where[] = ['w.audittime','<',$auditend];
        }
        
        if(!empty($transfer_card)){
            $where[] = ['w.transfer_card','like',"%$transfer_card%"];
        }
        
        
        if(!empty($withdrawal_amount)){
            $where[] = ['w.withdrawal','=',$withdrawal_amount];
        }
        
        $withdrawal = new Withdrawal();
        $list = $withdrawal->withdrawalList(1,5000,$where)->toArray();
        
        if(empty($list)){
            return json(['code' => 0, 'msg' => lang('未获取到需要导出数据'), 'data' => '', 'count' => '']);
        }
        $sumTOAccount = $withdrawal->withdrawalSumToAccount($where);//总计金额
        $expTableData = [];
        foreach ($list as $item){
            $exp = [];
            $exp['addtime'] = date( "Y-m-d H:i:s",$item['addtime']);
            $exp['phone'] = $item['phone'];
            $exp['uaddtime'] = date( "Y-m-d H:i:s",$item['uaddtime']);
            $exp['withdrawal'] = floatval($item['withdrawal']);
            $exp['fee'] = floatval($item['fee']);
            $exp['to_account'] = floatval($item['to_account']);
            $exp['transfer_card'] = $item['transfer_card'];
            $exp['transfer_name'] = $item['transfer_name'];
            //$exp['state'] = $item['state'];//支付状态 0：待审核  1：审核通过(待打款)  2：审核失败   3:已打款
            if($item['state']==0){
                $exp['state'] = "待审核";
            }
            elseif($item['state']==1){
                $exp['state'] = "审核通过(待打款)";
            }
            elseif($item['state']==2){
                $exp['state'] = "审核失败";
            }
            elseif($item['state']==3){
                $exp['state'] = "已打款";
            }
            $exp['remarks'] = $item['remarks'];
            $exp['audittime'] = '';
            if(!empty($item['audittime'])){
                $exp['audittime']  = date( "Y-m-d H:i:s",$item['audittime']); 
            }
            $expTableData[] = $exp;
        }
        $fileName = date('Y年m月d日H时i分',time());
        $Excel['fileName']=$fileName.'提现列表';//or $xlsTitle
        $Excel['cellName']=['A','B','C','D','E','F','G','H','I','J','K'];
        $Excel['H'] = ['A'=>28,'B'=>28,'C'=>28,'D'=>28,'E'=>28,'F'=>28,'G'=>28,'H'=>28,'I'=>28,'J'=>28,'K'=>28];//横向水平宽度
        //$Excel['V'] = ['1'=>40,'2'=>26];//纵向垂直高度
//        $Excel['sheetTitle']= '提现列表文件（总计金额：'.$sumTOAccount.'）';//大标题，自定义
        $Excel['xlsCell']=[
//            ['addtime','申请时间'],
//            ['phone','收款方支付宝账号(必填)'],
//            ['transfer_name','收款方姓名(必填)'],
//            ['to_account','金额(必填,单位：元)'],
//            ['remarks','备注(选填)'],
            
            ['addtime','申请时间'],
            ['phone','手机号码'],
            ['uaddtime','注册时间'],
            ['withdrawal','提现金额（元）'],
            ['fee','手续费（元）'],
            ['to_account','实际到账（元）'],
            ['transfer_card','提现卡号'],
            ['transfer_name','真实姓名'],
            ['state','提现状态'],
            ['remarks','备注'],
            ['audittime','审核时间'],
        ];

        Spread::excelPutContinuity($Excel,$expTableData);

    }
}
